class AlertFilter

  attr_accessor :dmin, :dmax, :dfrom, :dto, :idesc, :ihost, :edesc, :ehost, :limit

  def initialize
    @limit = 100
  end

  def setFromParams(params)
    @dmin = params[:dmin] unless params[:dmin].blank?
    @dmax = params[:dmax] unless params[:dmax].blank?
    @dfrom = params[:dfrom] unless params[:dfrom].blank?
    @dto = params[:dto] unless params[:dto].blank?
    @idesc = params[:idesc] unless params[:idesc].blank?
    @ihost = params[:ihost] unless params[:ihost].blank?
    @edesc = params[:edesc] if !params[:edesc].blank?
    @ehost = params[:ehost] if !params[:ehost].blank?
    @limit = params[:limit].to_i unless params[:limit].blank?
  end

end
